package com.service.pay.diamond.controller;

import com.service.pay.diamond.dto.OrderDto;
import com.service.pay.diamond.dto.request.PayOrderDto;
import com.service.pay.diamond.service.OrderService;
import com.tool.base.base.BaseDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pay")
public class PayController {
    @Autowired
    private OrderService orderService;

    @PostMapping("payOrder")
    public BaseDto<OrderDto> payOrder(@RequestBody PayOrderDto payOrderDto) {
        return new BaseDto<>(orderService.payOrder(payOrderDto));
    }
}
